{extend name="public/common"} {block name="body"}
<title>基本设置</title>
</head>

<style type="text/css">
.radius1{
	height: 40px;
	line-height: 30px !important;
    border-radius: 5px;
}
 .radius:hover{
 	background:#e5e5e5;
 	border-color: #e5e5e5;
 	color: #333;
 }
 .line{
 	position: absolute;
	right: 0;
	top: 13px;
	background: #636363;
	width: 1px;
	height: 14px;
	overflow: hidden;
 }
 .l{
 	position: relative;
 }
 .r{
 	display: inline-block;
 	height: 40px;
 	line-height: 40px;
 }
 .reload{
	 margin:15px 0;
	 text-align: left;
 }
 .reload .down{
	 margin-left: 20px;
	 border: 1px solid #409eff;
	 background-color: #409eff;
	 color: #fff;
 }
.reload	span{
	border: 1px solid #bfbfbf;
	padding: 5px;
}
.reload	.selected{
	border: 1px solid #409eff;
	color: #409eff;
}
</style>
<body>
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i>
		
		财务管理
		<span class="c-gray en">&gt;</span>
		公司入款审核
		<span class="c-gray en">&gt;</span>
		{if($stua==3)}线上待支付列表{/if}
		{if($stua==2)}充值审核未通过列表{/if}
		{if($stua==0)}线下待审核列表{/if}
		{if($stua==1)}充值审核成功列表{/if}
		{if($stua==9)}无效订单列表{/if}
		<a class="btn btn-success r"
			style="line-height: 1.6em; margin-top: 3px;border-radius: 5px;height: 34px;"
			href="javascript:location.replace(location.href);" title="刷新">
			<i class="Hui-iconfont">&#xe68f;</i>
		</a>
	</nav>
	
	<div style="padding:20px;height:30px;">
  	
  	<div class="new_box">
	<div class="cl pd-5 bg-1 bk-gray mt-20" style="height: 40px;background-color: #e5e5e5 !important; border-bottom: 1px solid #e4e7ed">


		<span class="l">
			<a class="btn btn-primary radius" data-title="线上待支付列表" href="{:url('recharge/cz_list_no')}?stua=3" {if($stua==3)}style="background:#636363;border-color: #636363;color: #fff;margin-left: -1px;"{/if}>线上待支付列表</a>
			<span class="line">◆</span>
		</span>
		
		<span class="l">
			<a class="btn btn-primary radius" data-title="线下待审核列表" href="{:url('recharge/cz_list_no')}?stua=0" {if($stua==0)}style="background:#636363;border-color: #636363;color: #fff;margin-left: -1px;"{/if}>线下待审核列表</a>
		<span class="line">◆</span>
		</span>
		
		<span class="l">
			<a class="btn btn-primary radius" data-title="已审核充值列表" href="{:url('recharge/cz_list_no')}?stua=1" {if($stua==1)}style="background:#636363;border-color: #636363;color: #fff;margin-left: -1px;"{/if}>充值审核成功列表</a>
		<span class="line">◆</span>
		</span>
		
		<span class="l">
			<a class="btn btn-primary radius" data-title="已审核充值列表" href="{:url('recharge/cz_list_no')}?stua=2" {if($stua==2)}style="background:#636363;border-color: #636363;color: #fff;margin-left: -1px;"{/if}>充值审核未通过列表</a>
		<span class="line">◆</span>
		</span>
		
		<span class="l">
			<a class="btn btn-primary radius" data-title="无效订单列表" href="{:url('recharge/cz_list_no')}?stua=9" {if($stua==9)}style="background:#636363;border-color: #636363;color: #fff;margin-left: -1px;"{/if}>无效订单列表</a>
		</span>
		{if condition="$stau eq '1'"}
		<span class="r">当前列表充值金额：<strong>{$money}</strong> 元</span> 
		<span class="r">充值总金额：<strong>{$zhmoney}</strong> 元&nbsp;&nbsp;&nbsp;&nbsp;</span> 
		{/if}
		{if condition="$stau eq '2'"}
		<a style="margin-left:20px;" href="{:url('recharge/oneKeyDelFail')}?stua=1" onclick="" class="btn btn-danger radius1">
		<i class="Hui-iconfont">&#xe6e2;</i> 一键删除审核未通过</a> 
		{/if}
	</div>
	<div>
	<div class="text-c" style="padding :20px 0;">
    <form action="/admin/recharge/cz_list_no?stua={$stau}" enctype="application/x-www-form-urlencoded" method="post" class="l" style="margin-left:20px;">

	{if(1==$stau || 0==$stau)}
		<span style="background-color: #e5e5e5;padding: 6px;margin-right: -5px;">入款账号</span>
		<select style="width:200px;" class="input-text" name="wfrom">
			<option value="0">全部</option>
			{volist name="pay_list" id="item"}
				<option value="{$item.type}_{$item.id}" {if($wfrom==$item['type'].'_'.$item['id'])} selected {/if}>
					{$item.pay_name}
					{if(1==$item.type)}
						_第三方支付
					{elseif(2==$item.type)}
						_第四方支付
					{elseif(3==$item.type)}
						_线下支付
					{else/}
						_未知渠道
					{/if}
				</option>
			{/volist}
		</select>
	{/if}
    <input type="text" name="server_user" value="{$username}" id="server_user" placeholder="用户名称" style="width:150px" class="input-text">
     &nbsp;&nbsp;&nbsp;&nbsp;从：
    <input type="text" name="start" {if condition="$time1 neq ''"}value="{$time1}"{/if} id="sDate1" onfocus="WdatePicker({maxDate:'%y-%M-%d'})" id="logmin" class="input-text Wdate" style="width:120px;">
     到：
    <input type="text" onfocus="WdatePicker({maxDate:'%y-%M-%d'})" name="end" {if condition="$time2 neq ''"}value="{$time2}"{/if} id="sDate2"  class="input-text Wdate" style="width:120px;margin-right:15px;">
    <button class="btn btn-success" type="submit" style="margin-right:20px;"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
	<button class="btn btn-success" type="button" onclick="downExcel()" style="margin-right:20px;"><i class="Hui-iconfont">&#xe640;</i> 下载报表</button>
	<button class="btn btn-warning" type="button" onclick="selectTime(-1,this)"  style="margin-right:20px;"><i class="Hui-iconfont">&#xe68f;</i>刷新</button>
	{if(0==$stau)}
		<div class="reload">
			<label style="margin-left: 5px;">自动刷新:</label>
			<span onclick="selectTime(0,this)" {if(0==$timing)} class="selected" {/if}>不自动刷新</span>
			<span onclick="selectTime(10,this)" {if(10==$timing)} class="selected" {/if}>10秒</span>
			<span onclick="selectTime(20,this)" {if(20==$timing)} class="selected" {/if}>20秒</span>
			<span onclick="selectTime(60,this)" {if(60==$timing)} class="selected" {/if}>60秒</span>
		</div>
	{/if}
	<input type="hidden" name="timing" value="{$timing}">
  </form>
  </div>
	</div>
	
	<div class="page-container dataTables_wrapper">
			<div id="tab-system" class="HuiTab">
				<div class="tabCon">
					<div class="mt-20">
						<table
							class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
							<thead>
								<tr class="text-c">
									<th>订单号</th>
									<th>玩家</th>
									<th>层级</th>
									<th>付款时间</th>
									<th>提交申请时间</th>
									 {if($stua==0 || $stua==1)}
									<th>线下审核时间</th>
									{/if}
									<th>账户</th>
									<th>存款渠道</th>
									<th>存款金额</th>
									<th>审核状态</th>
									{if($stau=='9')}
									<th>手动审核</th>
									{/if}
									<th>审核人</th>
									<th>IP</th>
									{if ($stua==2)}
									<th>取消原因</th>
									{/if}

								</tr>
							</thead>
							<tbody>
							{volist name="query" id="item"}
								<tr class="text-c" style="height:37px;">
									<td>{$item.ddbh}</td>
									<td>{$item.username}</td>
									<td>{$item.class_name}</td>
									<td>
									{if($item.pay_time!='')}
										{$item.pay_time|date="m/d H:i",###}
									{/if}
									</td>
									<td>{$item.cztime|date="m/d H:i",###}</td>
									{if($stua==0 || $stua==1)}
									<td>{if($item.shtime!='')}{$item.shtime|date="m/d H:i",###}{/if}</td>
									{/if}
									<td>{$item.openren}</td>
									<td>{$item.xxbank}--{$item.liuyan}</td>
									<td>{$item.je}</td>
									<td class="f-14 td-manage">
									{if($item.zt == 0)}
										{if($item.czclass == 1)}
										<span style="text-decoration: none;padding:4px 4px 4px 7px;background-color:red;color:white;" class="ml-5">
										等待支付
										</span>
										{else /}
											<a onclick="if(confirm('确定审核吗?')==false)return false;" style="text-decoration: none;padding:4px 10px 4px 14px;background-color:#409eff;color:white;" class="ml-5 chongzhi" href="/admin/recharge/throughAudit?czid={$item.id}&&statu=1">
												审核
											</a>
											<a onclick="open_zhixing_4({$item.id})" style="text-decoration: none;padding:4px 10px 4px 14px;background-color:#fff;color:#333;border: 1px solid #ccc;" class="ml-5 jujue" href="javascript:;">
												拒绝
											</a>
										{/if}
									{else /}
											{if($item.czclass == 1 && $item.zt == 1)}
											<span style="text-decoration: none;padding:4px 10px 4px 14px;background-color:#5eb95e;color:white;" class="ml-5">
											支付成功
											</span>
											{/if}
											{if($item.czclass != 1 && $item.zt > 0)}
											<span style="text-decoration: none;padding:4px 10px 4px 14px;background-color:#5eb95e;color:white;" class="ml-5">
											审核成功
											</span>
											{/if}
											{if($item.czclass != 1 && $item.zt < 0)}
											<span style="text-decoration: none;padding:4px 4px 4px 7px;background-color:red;color:white;" class="ml-5">
											审核未通过
											</span>
											{/if}
											{if($item.zt == 9)}
											<span style="text-decoration: none;padding:4px 4px 4px 7px;background-color:red;color:white;" class="ml-5">
											无效订单
											</span>
											{/if}
									{/if}
									</td>
									{if($stau=='9')}
									<td>
										<a onclick="if(confirm('确定审核吗?')==false)return false;" style="text-decoration: none;padding:4px 10px 4px 14px;background-color:#409eff;color:white;" class="ml-5 chongzhi" href="{:url('recharge/ManualReview')}?czid={$item.id}&&statu=1">
											审核
										</a>
									</td>
									{/if}
									<td>{$item.czadmin}</td>
									<td>{$item.czip}</td>
									{if ($stua==2)}
									<td>{$item.beizhu}</td>
									{/if}
								</tr>
								{/volist}
							</tbody>
						</table>
					</div>
				</div>
			</div>
  	<div class="dataTables_paginate paging_simple_numbers" style="width:100%;">
  		<div style="float:left;">  
          每页显示<select name="limit" style="height:26px;" id="code">
          		<option value="20" {if condition="$limit eq 20"}selected{/if}>
                20
              </option>
              <option value="50" {if condition="$limit eq 50"}selected{/if}>
                50
              </option>
              <option value="100" {if condition="$limit eq 100"}selected{/if}>
                100
              </option>                   
           </select>页
          </div>
		<span style="float:right;margin-left:-2px;">总共{$query->lastPage()}页  当前第{$query->currentPage()}页 ，共{$query->total()}条</span>
		<div style="float:left;">{$query->render()}</div>
    </div>
	</div>
	</div>
	</div>
	<div id="warning" style="display: none;"></div>
<input type="hidden" value="{$stau}" id="stau" />
	{/block} {block name="js"}

<script type="text/javascript" src="__SYSMET__/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript">
    $(function() {
  $('.skin-minimal input').iCheck({
    checkboxClass : 'icheckbox-blue',
    radioClass : 'iradio-blue',
    increaseArea : '20%'
  });
  $("#tab-system").Huitab({
    index : 0
  });
});
	setInterval(function () {
		$.get(
			'/admin/index/warning',
			function(data){
				var message = eval("("+data+")");
				if(message.xx){
					var xxdata = message.xx;
					for( var key in xxdata ){
						if( 2==parseInt(key) ){
							$('#warning').html(xxdata[key]);
						}
					}
				}
				if(message.xs){
					var xsdata = message.xs;
					for( var key in xsdata ){
						if( 2==parseInt(key) ){
							$('#warning').html(xsdata[key]);
						}
					}
				}
			},'json'
		);
	},15*1000);
</script>
<script>
$(function(){
	$("#code").on('change',function(){
		var username=$("#server_user").val();
		var time1=$("#sDate1").val();
		var time2=$("#sDate2").val();
		var stau=$("#stau").val();
		var id = $(this).find('option:selected').val();
		var timing = $('input[name="timing"]').val();
		window.location.href = "/admin/recharge/cz_list_no?username="+username+"&limit="+id+"&start="+time1+"&end="+time2+"&stua="+stau+'&wfrom='+'{$wfrom}'+'&timing='+timing+'&page=1';
	})
});

</script>
<script type="text/javascript">
function open_zhixing_4(id){
	var id=id;
	var statu=-1;
	layer.open({
		title:"备注",
		content:'<textarea id="tuibz" cols="35" rows="5" value=""></textarea><p style="color:red">请填写拒绝原因</p>',
		yes: function(index, layero){
				var beizhu = $("#tuibz").val();
				window.location.href="/admin/recharge/throughAudit?czid="+id+"&beizhu="+beizhu+"&statu="+statu;
			}
		});
	}
var timing = $('input[name="timing"]').val();
var timeInterval = null;

var username=$("#server_user").val();
var time1=$("#sDate1").val();
var time2=$("#sDate2").val();
var stau=$("#stau").val();
var id = $('#code').find('option:selected').val();
var page = '{$query->currentPage()}';

if( 0!=parseInt(timing) ){
	timeInterval = setInterval(function () {
		window.location.href = "/admin/recharge/cz_list_no?username="+username+"&limit="+id+"&start="+time1+"&end="+time2+"&stua="+stau+'&wfrom='+'{$wfrom}'+'&timing='+timing+'&page='+page;
	},timing*1000)
}
function selectTime(type,obj){

	$('.reload').children().removeClass('selected');
	$(obj).addClass('selected');
	var username=$("#server_user").val();
	var time1=$("#sDate1").val();
	var time2=$("#sDate2").val();
	if( -1==type ){
		type = $('input[name="timing"]').val();
		window.location.href = "/admin/recharge/cz_list_no?username="+username+"&limit="+id+"&start="+time1+"&end="+time2+"&stua="+stau+'&wfrom='+'{$wfrom}'+'&timing='+type+'&page='+page;
	}else if( 0==type && timing!=null ){
		clearInterval(timeInterval);
		$('input[name="timing"]').val(type);
	}else if( 0!=type ){
		$('input[name="timing"]').val(type);
		window.location.href = "/admin/recharge/cz_list_no?username="+username+"&limit="+id+"&start="+time1+"&end="+time2+"&stua="+stau+'&wfrom='+'{$wfrom}'+'&timing='+type+'&page='+page;
	}
}
function downExcel(){
	var username=$("#server_user").val();
	var time1=$("#sDate1").val();
	var time2=$("#sDate2").val();
	var text = $('select[name="wfrom"]').find('option:selected').text();
	location.href = '{:url('recharge/downExcel')}'+"?username="+username+"&start="+time1+"&end="+time2+"&stua="+stau+'&wfrom='+'{$wfrom}'+'&title='+text;
}
</script>
{/block}
